﻿@{
    ViewBag.Title = "Index";
    Layout = "~/Views/Shared/_ManufactureList.cshtml";
}

<h2>Index</h2>
<script type="text/javascript">
    $(function () {
        initControl();
        gridList();
    });
    function initControl() {
        $('select').bindSelect();
    }
    function gridList() {
        var $gridList = $("#gridList");
        $gridList.dataGrid({
            url: "/BOM/Product/GetStampingListJson",
            height: $(window).height() - 118,
            colModel: [
                { label: '零部件号', name: 'FProductionNO', width: 100, align: 'center' },
                { label: '零件名称', name: 'MC', width: 120, align: 'center' },
                { label: '批次号', name: 'AssembleLine', width: 120, align: 'center' },
                { label: '凭证编号', name: 'MakeLine', width: 120, align: 'center' },
            ],
            pager: "#gridPager",
            sortname: 'FProductionNO asc',
            viewrecords: true
        });
        $("#btn_search").click(function () {
            $gridList.jqGrid('setGridParam', {
                postData: { number: $("#txtNumber").val(), name: $("#txtName").val(), assemble: $("#txtAssemble").val(), make: $("#txtMake").val() },
            }).trigger('reloadGrid');
        });
    }
</script>
<div id="layout" style="height: 100%; width: 100%;">
    <form id="form1">
        <div style="padding: 12px 0 5px 0; padding-left: 15px; border-bottom: 1px solid #ccc; " class="line-table input-width-185">
            <div class="btn-group" style="margin-top:-9px;">
                零部件号<br /><input id="txtNumber" name="txtNumber" type="text" class="form-control" /> &nbsp;
            </div>
            <div class="btn-group" style="margin-top:-9px;">
                零件名称<br /><input id="txtName" name="txtName" type="text" class="form-control" /> &nbsp;
            </div>
            <div class="btn-group" style="margin-top:-9px;">
                批次号<br /><input id="txtAssemble" name="txtAssemble" type="text" class="form-control" /> &nbsp;
            </div>
            <div class="btn-group" style="margin-top:-9px;">
                凭证编号<br /><input id="txtMake" name="txtMake" type="text" class="form-control" /> &nbsp;
            </div>
            <div class="btn-group" style="">
                <a id="btn_search" class="btn btn-primary center-block" onclick=""><span class="glyphicon glyphicon-search"></span> 检索</a>
            </div>
        </div>
    </form>
    <div style="">
        <table id="gridList"></table>
        <div id="gridPager"></div>
    </div>
</div>
